How can I set `less` or `more` max lines (scrollable height) limit/boundary in linux?

Posted by Rudie on Super User See other posts from Super User or by Rudie
Published on 2012-06-12T21:10:58Z Indexed on 2012/06/12 22:43 UTC
Read the original article Hit count: 155

Filed under:
|
|
|
|

(Sorry for the title. Any suggestions?)

I've set my commandline PS1 to cover 3 lines:

  1. white space
  2. user, server and pwd
  3. $ or # to input

I think less (or more?) is configured to break after window's height - 1, because when I do a $ git log, the first two lines are invisible at the top of the window and the rest is scrollable.

I'm not sure who handles this scrolling and its configuration, but I assume GIT uses less/more.

Where can I configure that my scrollable window is window height - 3 lines and not window height - 1?

More info:

  • If I cat lines.txt | less with a 23 line file, it shows the entire file and no scrolling.
  • If I do the same with a 24 line file, it doesn't show line 1 (and no scrolling).
  • With 25 lines: doesn't show lines 1 and 2 (and no scrolling).
  • With 26 lines: shows line 1 and scrolling!

The less breakpoint is at the wrong height...

© Super User or respective owner

Related posts about linux

Related posts about command-line